/*
package com.ssm.opa.api.base.handler;

import com.ssm.gtb.common.base.constants.ErrorCode;
import com.ssm.gtb.common.base.exception.GTBException;
import com.ssm.gtb.common.base.exception.SysException;
import com.ssm.gtb.common.base.utils.JsonUtil;
import com.ssm.gtb.common.entity.dto.BaseResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

*/
/**
 * <p/>
 * Copyright: Copyright (c) 2017/9/28
 * <p/>
 * Company: 途牛科技有限公司华东分公司
 * <p/>
 * Controller异常统一处理类
 * @author lubin2@tuniu.com
 * @version 1.0.0
 * @project gtb-parent
 *//*

@ControllerAdvice
public class ExceptionControllerAdvice {

	private final Logger LOGGER = LoggerFactory.getLogger(ExceptionControllerAdvice.class);

	@ExceptionHandler(value = GTBException.class)
	@ResponseBody
	public BaseResponse GTBExceptionHandler(GTBException e) {
		BaseResponse resp = new BaseResponse();

		resp.setErrorCode(e.getErrorCode());
		resp.setMsg(e.getMessage());
		resp.setSuccess(false);

		try {
			LOGGER.error("controller业务异常捕获:{}", JsonUtil.toJSONString(resp));
		}catch (SysException sys){
			LOGGER.error("msg:{};errorCode", sys.getMessage(), sys.getErrorCode());
		}

		return resp;
	}

	@ExceptionHandler(value = SysException.class)
	@ResponseBody
	public BaseResponse SysExceptionHandler(SysException e) {
		BaseResponse resp = new BaseResponse();

		resp.setErrorCode(e.getErrorCode());
		resp.setMsg(e.getMessage());
		resp.setSuccess(false);

		try {
			LOGGER.error("controller系统异常捕获:{}", JsonUtil.toJSONString(resp));
		}catch (SysException sys){
			LOGGER.error("msg:{};errorCode", sys.getMessage(), sys.getErrorCode());
		}

		return resp;
	}

	@ExceptionHandler(Throwable.class)
	@ResponseBody
	public BaseResponse UnknownExceptionHandler(Throwable e) {
		BaseResponse resp = new BaseResponse();

		resp.setErrorCode(ErrorCode.SYSTEM_ERROR);
		resp.setMsg("未匹配错误信息");
		resp.setSuccess(false);

		LOGGER.error("未匹配的错误信息,{}", e);
		return resp;
	}
}
*/
